﻿/*
 * Copyright(C) 2012,ajayumi 保留所有权利。( All rights reserved. )
 * 
 * 文件名称：TestInfo.cs
 * 摘    要：
 * 当前版本：1.0
 * 作    者：黄乙冬 (ajayumi)
 * 创建日期：2012年6月12日星期二
 */
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ajayumi.Platform.Core.Model;

namespace ajayumi.Platform
{
    public class TestInfo : EditableModelBase
    {
        public int Id { get; set; }

        public string Name { get; set; }

        public string Remark { get; set; }

        protected override void BackupRecord()
        {
            this.History.Add("Id", this.Id);
            this.History.Add("Name", this.Name);
            this.History.Add("Remark", this.Remark);
            Console.WriteLine("Backup -- Id: {0}, Name: {1}, Remark: {2}", this.Id, this.Name, this.Remark);
        }

        protected override void RestoreRecord()
        {
            this.Id = (int)this.History["Id"];
            this.Name = this.History["Name"] != null ? this.History["Name"].ToString() : string.Empty;
            this.Remark = this.History["Remark"] != null ? this.History["Remark"].ToString() : string.Empty;
        }
    }
}
